/**
 * Created by Julia on 2016/05/03.
 */

define(function () {
    return {
        rules:{
            loginName: {
                required: true,
                loginNameCheck: true,
                maxlength: 32
            },
            name: {
                required: true,
                maxlength: 32
                //nameCheck: true
            },
            password: {
                required: true,
                minlength: 6,
                maxlength: 32,
                passwordCheck: true
            },
            repassword: {
                required: true,
                equalTo: '#password'
            },
            email: {
                required: true,
                maxlength: 64,
                email: true
            }
        },
        messages: {
            loginName: {
                required: $.i18n.prop('VALIDATE_REQUIRED', $.i18n.prop('USER_LOGINNAME')),
                maxlength: $.i18n.prop('VALIDATE_CHARACTER_SIZE_MAX', 32)
            },
            name: {
                required: $.i18n.prop('VALIDATE_REQUIRED', $.i18n.prop('USER_NAME')),
                maxlength: $.i18n.prop('VALIDATE_CHARACTER_SIZE_MAX', 32)
            },
            password: {
                required: $.i18n.prop('VALIDATE_REQUIRED', $.i18n.prop('USER_PASSWORD')),
                minlength: $.i18n.prop('VALIDATE_CHARACTER_SIZE_MIN', 6),
                maxlength: $.i18n.prop('VALIDATE_CHARACTER_SIZE_MAX', 32)
            },
            repassword: {
                required: $.i18n.prop('VALIDATE_REQUIRED', $.i18n.prop('USER_REPASSWORD')),
                equalTo: $.i18n.prop('VALIDATE_PASSWORD_SAME')
            },
            email: {
                required: $.i18n.prop('VALIDATE_REQUIRED', $.i18n.prop('USER_EMAIL')),
                email: $.i18n.prop('VALIDATE_AVALID', $.i18n.prop('USER_EMAIL')),
                maxlength: $.i18n.prop('VALIDATE_CHARACTER_SIZE_MAX', 64)
            }
        }
    }
});
